﻿@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'laydate', 'common', 'iconPickerFa', 'optimizeSelectOption'], function () {
        var form = layui.form,
            $ = layui.$,
            common = layui.common,
            iconPickerFa = layui.iconPickerFa,
            laydate = layui.laydate;
        var keyValue = $.request("keyValue");
        //权限字段
        common.authorizeFields('adminform');
        $(function () {
            initControl();
            if (!!keyValue) {
                common.ajax({
                    url: "/SystemManage/Module/GetFormJson",
                    dataType: "json",
                    data: { keyValue: keyValue },
                    async: false,
                    success: function (data) {
                        common.val('adminform', data);
                        if (!!data.F_Icon) {
                            iconPickerFa.checkIcon('iconPicker', data.F_Icon);
                        }
                        common.setReadOnly('adminform');
                    }
                });
            }
            form.render();
        });
        wcLoading.close();
        iconPickerFa.render({
            // 选择器，推荐使用input
            elem: '#iconPicker',
            // fa 图标接口
            url: "/lib/font-awesome-4.7.0/less/variables.less",
            // 是否开启搜索：true/false，默认true
            search: true,
            // 是否开启分页：true/false，默认true
            page: true,
            // 每页显示数量，默认12
            limit: 12,
            // 点击回调
            click: function (data) {
                //console.log(data);
                $("#F_Icon").val("fa " + data.icon);
            },
            // 渲染成功后的回调
            success: function (d) {
                //console.log(d);
            }
        });
        function initControl() {
            $("#F_ParentId").bindSelect({
                url: "/SystemManage/Module/GetTreeSelectJson",
            });
        }
    });
</script>
<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div class="layui-form layuimini-form" lay-filter="adminform">
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">上级</label>
                    <div class="layui-input-block">
                        <select id="F_ParentId" name="F_ParentId">
                            <option value="0">父节点</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">编号</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_EnCode" name="F_EnCode" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_FullName" name="F_FullName" lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">连接</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_UrlAddress" name="F_UrlAddress" lay-verify="required" class="layui-input ">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">目标</label>
                    <div class="layui-input-block">
                        <select id="F_Target" name="F_Target" lay-verify="required">
                            <option value="">==请选择==</option>
                            <option value="expand" title="expand">无页面</option>
                            <option value="iframe" title="iframe">框架页</option>
                            <option value="open" title="open">弹出页</option>
                            <option value="blank" title="blank">新窗口</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">图标</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_Icon" name="F_Icon" class="layui-input layui-hide">
                        <input type="text" id="iconPicker" @*value="fa fa-file-image-o"*@ lay-filter="iconPicker" class="hide">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">显示顺序</label>
                    <div class="layui-input-block">
                        <input  type="number" pattern="[0-9]*" id="F_SortCode" name="F_SortCode" lay-verify="required" class="layui-input ">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">选项</label>
                    <div class="layui-input-block">
                        <input id="F_IsMenu" name="F_IsMenu" type="checkbox" value="false" title="菜单">
                        <input id="F_IsExpand" name="F_IsExpand" type="checkbox" value="false" title="展开">
                        <input id="F_IsPublic" name="F_IsPublic" type="checkbox" value="true" title="公共">
                        <input id="F_IsFields" name="F_IsFields" type="checkbox" value="false" title="字段">
                        <input type="checkbox" name="F_EnabledMark" id="F_EnabledMark" checked="" value="true" title="有效">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text layui-hide">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea id="F_Description" name="F_Description" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>